The present invention relates to an electronic musical instrument which performs various processes using multi-task techniques.
A typical example of an electronic musical instrument which performs various processes using multi-task techniques is disclosed such as in Japanese Patent Laid-open Publication No. HEI 5-249956.
Ordinarily, the multi-task processing is performed by assigning priority order to individual tasks, and the inter-task communication is provided by issuing a message directed to another task. The issued message is temporarily stored in a buffer so as to be processed when the other task is activated.
However, the above-mentioned conventional task-processing may suffer from the following inconvenience if the priority order and message buffering system are taken into account.
If message transfer occurs in succession with respect to a particular task of relatively low priority order, many messages of a same type will be accumulated in the buffer. These messages are processed in the order of arrival at the task, and so, in such a case where all the messages in the buffer are processed, processing of the messages of the same type will be repetitively performed a plurality of times.
For example, let it be assumed that, for a task for carrying out an effect imparting process in an electronic musical instrument based on real-time processing, two messages for changing an effect type are transmitted to the task and stored into the buffer before the task is activated. In such a case, it is the second, i.e., succeeding effect type changing message that becomes ultimately effective, and the first, i.e., preceding message does not have any influence even if it is ever processed. In other words, immediately after the preceding effect type changing message is processed, the succeeding effect type changing message of the same type is again processed, and thus the processing of the preceding message results in a mere waste of time. In this way, sequential processing of the messages in the order of their arrival would very often presents the inconvenience as noted above.
The reason why many messages are accumulated in the buffer is that the task processing the messages is essentially of low priority order. Accordingly, it is also provable that another task is called upon before all the contents of the buffer are processed. In such a case, if the messages are always processed in the order of their arrival, the last-arriving and most effective message is not immediately reflected, with the result that the processing tends to be entirely based on an old message without the effective message being processed.